package javaconfig;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component // 带注解的类，我们希望用这种方式定义bean，并让Spring把它吃进去
public class Person {

	@Autowired
	private Car car;

	public Person() {
		System.out.println(car);
	}

	@Override
	public String toString() {
		return "Person{" + "car=" + car + '}';
	}
}
